package org.zdd.bookstore.model.dao;

import org.apache.ibatis.annotations.Param;
import org.zdd.bookstore.common.utils.MyMapper;
import org.zdd.bookstore.model.entity.Comment;

import java.util.Date;
import java.util.List;

public interface CommentMapper extends MyMapper<Comment> {

    List<Comment> selectById(@Param("bookId") Integer bookId);

    /**
     * 添加评论
     * @return
     */
    Integer addComment(@Param("userId") Integer userId, @Param("username") String username, @Param("bookId") Integer bookId, @Param("content") String content, @Param("date") Date date);


    /**
     * 删除评论
     * @param userId
     * @return
     */
    Integer deleteComment(Integer userId);

    Comment selectBookId(@Param("commentId") Integer commentId);


    Comment selectUserId(@Param("commentId") Integer commentId);
}